<?php

namespace app\test\model;

/**
 * Created by PhpStorm.
 * User: Xyzhao
 * Date: 2017/7/18
 * Time: 11:52
 */

use think\Model;
use think\Session;

class Users extends Model
{
	public function index()
	{
		$res = $this->query('SELECT * FROM `users`,`authority` WHERE `CSUid`=? AND `name`=?;',
			[Session::get('CSUid'), Session::get('name')])[0];
		unset($res['password']);
		unset($res['phone']);
		unset($res['email']);
		unset($res['qq']);
		unset($res['openid']);
		$res['authority'] = json_decode($res['authority']);
		return $res;
	}
}